package com.atguigu.gulimall.ware.dao;

import com.atguigu.common.to.mq.StockDetailTo;
import com.atguigu.gulimall.ware.entity.WmsWareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 * 
 * @author zhangxiaosan
 * @email 424207204@qq.com
 * @date 2021-05-12 21:52:47
 */
@Mapper
public interface WmsWareSkuDao extends BaseMapper<WmsWareSkuEntity> {

    void addStock(Long skuId, Long wareId, Integer skuNum);

    Integer getSkuHasStock(@Param("skuId") Long skuId);

    List<Long> listWareIdHasSkuStock(@Param("skuId") Long skuId);

    Long lockSkuStock(@Param("skuId") Long skuId,@Param("wareId") Long wareId, @Param("num") Integer num);

    void returnStock(@Param("stockDetailTo")StockDetailTo stockDetailTo);


}
